summaryrefslogtreecommitdiff
path: root/app/[lng]/evcp/(evcp)/bid/[id]/detail/page.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'app/[lng]/evcp/(evcp)/bid/[id]/detail/page.tsx')
-rw-r--r--app/[lng]/evcp/(evcp)/bid/[id]/detail/page.tsx52
1 files changed, 52 insertions, 0 deletions
diff --git a/app/[lng]/evcp/(evcp)/bid/[id]/detail/page.tsx b/app/[lng]/evcp/(evcp)/bid/[id]/detail/page.tsx
new file mode 100644
index 00000000..ac9b5df4
--- /dev/null
+++ b/app/[lng]/evcp/(evcp)/bid/[id]/detail/page.tsx
@@ -0,0 +1,52 @@
+import { Suspense } from 'react'
+import { notFound } from 'next/navigation'
+import { getBiddingDetailData } from '@/lib/bidding/detail/service'
+import { BiddingDetailContent } from '@/lib/bidding/detail/table/bidding-detail-content'
+
+// 메타데이터 생성
+export async function generateMetadata({ params }: { params: Promise<{ id: string }> }) {
+ const { id } = await params
+ const parsedId = parseInt(id)
+ if (isNaN(parsedId)) return { title: '입찰 관리상세' }
+
+ try {
+ const detailData = await getBiddingDetailData(parsedId)
+ return {
+ title: detailData.bidding ? `${detailData.bidding.title} - 입찰 관리상세` : '입찰 관리상세',
+ }
+ } catch {
+ return { title: '입찰 관리상세' }
+ }
+}
+
+interface PageProps {
+ params: Promise<{ id: string }>
+}
+
+export default async function Page({ params }: PageProps) {
+ const { id } = await params
+ const parsedId = parseInt(id)
+
+ if (isNaN(parsedId)) {
+ notFound()
+ }
+
+ // 통합 데이터 로딩 함수 사용
+ const detailData = await getBiddingDetailData(parsedId)
+
+ if (!detailData.bidding) {
+ notFound()
+ }
+
+ return (
+ <Suspense fallback={<div className="p-8">로딩 중...</div>}>
+ <BiddingDetailContent
+ bidding={detailData.bidding}
+ quotationDetails={detailData.quotationDetails}
+ quotationVendors={detailData.quotationVendors}
+ biddingCompanies={detailData.biddingCompanies}
+ prItems={detailData.prItems}
+ />
+ </Suspense>
+ )
+}